package com.wangp.enjoywork.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyConfig {
	
	@Bean
	public MyWebMvcConfig myWebMvcConfig(){
		return new MyWebMvcConfig();
	}
	
	
	public class MyWebMvcConfig implements WebMvcConfigurer{
		
		@Override
		public void addViewControllers(ViewControllerRegistry registry) {
			registry.addViewController("/").setViewName("index");
			registry.addViewController("/index.html").setViewName("index");
			registry.addViewController("/enjoywork").setViewName("index");
			registry.addViewController("/enjoy").setViewName("index");
			registry.addViewController("/ew").setViewName("index");
		};
		
		

		
	}
	
}
